/***************************************************************************
 *   Copyright 2010 long2015 liu <long2015@gmail.com>
 *
 *   This program is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU General Public
 *   License as published by the Free Software Foundation; either
 *   version 2 of the License, or (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 ***************************************************************************/

#ifndef RWINDOW_H
#define RWINDOW_H

#include<QtGui>
#include<QWidget>
#include<QPixmap>
#include<QPainter>
#include<QString>
#include<QList>
//#include "fivechess.h"

#define WIDTH 30
#define OFFSET 16
#define WHITE 0
#define BLACK 1
#define BLANK 2
#define MAXCHESS 20

class Rwindow : public QWidget
{
    Q_OBJECT
public:
   Rwindow(QWidget *parent=0);
   void paintEvent(QPaintEvent *);
   void mousePressEvent(QMouseEvent *);
   bool isSucceed();
   QPoint AINext();
   bool isPut(QPoint);

public slots:
   void drawBoard();
   int goBack();

private:
   QPushButton *startButton;
   QPushButton *backButton;
   QPixmap chessBoard;
   QString bgFile;
   QPoint currentPos;
   int cols;
   int chess[20][20];
   int nextStep;
   QList<QPoint> whiteList, blackList;
};

#endif // RWINDOW_H
